﻿@model IEnumerable<PessModel.sp_GetArchiveExpertScores_Result>

@{
    Layout = null;
}


@if(Model!=null)
{

<table>
    <tr>

        <th>
            Rule
        </th>
        <th>
            Description
        </th>
        <th>
            Scale
        </th>

        <th>
            Score
        </th>
        <th>
            Reviewer
        </th>

    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Value)
        </td>

        <td>
            @Html.DisplayFor(modelItem => item.ScoreValue)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ExpertJudgeSerialNumber)
        </td>
    </tr>
}
    <tr>

        <td>
            Total
        </td>
        <td>
            
        </td>
        <td>
            
        </td>

        <td>
            @{
    decimal? totalScore=0;
    for (int i = 0; i < Model.Count();i++ )
    {
        totalScore += Model.ElementAt(i).ScoreValue;
    }
                
                }@totalScore
        </td>
        <td>
            
        </td>

    </tr>
</table>
}
